package com.nsn.auction.dao.impl;

import java.util.List;

import com.nsn.auction.dao.PriceDao;
import com.nsn.auction.domina.Price;
import com.nsn.auction.util.CustomHibernateDaoSupport;

public class PriceDaoImpl extends CustomHibernateDaoSupport implements PriceDao {

	@Override
	public void save(Price price) {
		getHibernateTemplate().save(price);

	}

	@Override
	public void update(Price price) {
		getHibernateTemplate().update(price);

	}

	@Override
	public void delete(Price price) {
		getHibernateTemplate().delete(price);

	}

	@Override
	public Price findPriceById(Long priceId) {
		List<Price> list = getHibernateTemplate().find("from Price where priceId=?", priceId);
		if (list.size() == 0)
			return null;
		else
			return list.get(0);
	}

}
